layui.use(['layer', 'jquery', 'form'], function() {
    var $ = layui.jquery;
    var layer = layui.layer;
    var form = layui.form;
    let token = localStorage.getItem('token'); //获取用户token

    $('#books tr', parent.document).remove();

    //重新查询
    function classrefresh() {
        $.ajax({
            method: 'GET',
            url: '/my/article/cates',
            success: function(result) {
                if (result.status == 0) {
                    console.log(result);

                    let trs = '';
                    result.data.forEach(function(item) {
                        let tr =
                            `<tr><td id='booksid' name='Id' style='display:none'>${item.Id}</td><td>${item.name}</td><td>${item.alias}</td>
                                <td><button type="button" class="layui-btn layui-btn-normal editbooks">编辑</button><button type="button" class="layui-btn layui-btn-danger delbooks">删除</button></td></tr>`;

                        trs += tr;


                    })
                    $('#books', parent.document).append(trs);
                }
            }
        })


    }


})
